using System.Collections;
using System.Collections.Generic;
using MyFrame.Single;
using UnityEngine;

namespace MyFrame.Save
{
    public class JsonSaveMgr : Singleton<JsonSaveMgr>
    {
        public void Save(string key, Object data)
        {
            var jsonData = JsonUtility.ToJson(data);
            PlayerPrefs.SetString(key, jsonData);
        }

        public T Load<T>(string key) where T : Object
        {
            var jsonData = PlayerPrefs.GetString(key);
            return JsonUtility.FromJson<T>(jsonData);
        }
    }
}

